package org.zoomdev.zoom.aop.utils;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public class ScannInnerVisitor extends ClassVisitor {
    protected ScannInnerVisitor() {
        super(Opcodes.ASM9);
    }

    @Override
    public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
        MethodVisitor mv= super.visitMethod(access, name, descriptor, signature, exceptions);
        if ((access & Opcodes.ACC_SYNTHETIC) == 0 && !name.equals("<init>")) {
            System.out.println("访问匿名类方法: " + name + descriptor);
            return new AnonymousMethodVisitor(api, mv);
        }
        return mv;
    }
}
